package com.sockettest.QQChatv1;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;

public class Test {
    public static void main(String[] args) throws IOException {
        System.out.println(Test.class.getClassLoader().getResource(""));
        System.out.println(System.getProperty("user.dir"));
//        注意，路径应为文件在工程中的相对路径
        File f=new File("src/test.txt");

        System.out.println(".......");
        System.out.println(f.getPath());
        System.out.println(f.getAbsolutePath());
        System.out.println(f.getCanonicalPath());
        BufferedReader reader=new BufferedReader(new FileReader(f));
        String temp=null;
        int line=1;
        while((temp=reader.readLine())!=null){
            System.out.println("line"+line+":"+temp);
            line++;
        }
    }
}
